<template>
  <div>
<div v-for="(i,x) in list" :key="x">

    <el-container>
    <el-header><span>{{i.type}}</span></el-header>
    <el-main>
        <span>需求标题：{{i.title}}</span><br>
        <span>需求描述：{{i.name}}</span><br>
        <span>订单金额：{{i.money}}</span><br>
    </el-main>
     
    
    </el-container>
 <el-container>
     <el-main>
<span>需求类型： {{i.trade}}</span><br>
        <span>解决方式： 买服务</span><br>
        </el-main>
    </el-container>
   <el-button>邀请他</el-button>
   <el-button @click="grab">参与需求</el-button>

    <a href="http://localhost:8080/trouser" target="_blank">在线咨询</a><br>
    <a href="http://localhost:8080/trokefu" target="_blank">客服</a>


</div>
    

  </div>
</template>

<script>
export default {
    data(){
        return{
            code:this.$route.params.code,
            list:[],
               aa:this.$route.path,
               userid:localStorage.getItem('userid'),

        }
    },
    methods:{
        getprocode(){
            this.axios.get('getcode?code='+this.code)
            .then(res=>{
                this.list = res.data.data
            })

        },
        getbrowsing(){
    this.axios.get('browsing?userid='+this.userid+'&url='+this.aa)
    .then(res=>{
        console.log(res)
    })
  }

    },
    mounted(){
        this.getprocode()
        this.getbrowsing()

    }

}
</script>

<style>
 .el-header, .el-footer {
    background-color: #B3C0D1;
    color: #333;
    text-align: center;
    line-height: 60px;
  }
  
  .el-aside {
    background-color: #D3DCE6;
    color: #333;
    text-align: center;
    line-height: 200px;
  }
  
  .el-main {
    background-color: #E9EEF3;
    color: #333;
    text-align: center;
    line-height: 160px;
  }
  
  body > .el-container {
    margin-bottom: 40px;
  }
  
  .el-container:nth-child(5) .el-aside,
  .el-container:nth-child(6) .el-aside {
    line-height: 260px;
  }
  
  .el-container:nth-child(7) .el-aside {
    line-height: 320px;
  }
</style>